package com.yuw.singleton;

import java.util.Scanner;

public class SingleTonTestdriver {
    public static void main(String[] args) {
        // 获取单例模式类的一个实例对象
        SingleTon st0 = SingleTon.getSingleTonInstance();
        // 获取单例模式类的一个实例对象
        SingleTon st1 = SingleTon.getSingleTonInstance();
        // 判定这两个实例变量是不是同一个实例变量
        System.out.println("st0 == st1:"+(st0 == st1));
        System.out.println("st0.hashCode::"+st0.hashCode());
        System.out.println("st1.hashCode::"+st1.hashCode());

        System.out.println("-------------------------");
        Student stu0 = new Student();
        Student stu1 = new Student();
        System.out.println("stu0 == stu1:"+(stu0 == stu1));
        System.out.println("stu0.hashCode::"+stu0.hashCode());
        System.out.println("stu1.hashCode::"+stu1.hashCode());
        Scanner scanner = null;
    }
}
